<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@include("layouts.common.head")
<!-- Fonts -->
    <link href="{{ asset('static/css/company/common.css') }}" rel="stylesheet">
    <link href="{{ asset('static/css/company/company_resumes.css') }}?v=<?php echo time()?>" rel="stylesheet">
    <!-- Styles -->
    <style>
        html {
            overflow-y: scroll;
        }
    </style>
</head>
<body>
<div id="app">
    @include("layouts.nav")
    @include("company.resume.other_top_nav")
    <div class="user_main">
        <div class="mleft">
            <div class="left_jobs">
                <div class="li link_gray6 J_hoverbut t5" onclick="window.location='{{url('company/resume')}}'">收到的简历
                </div>
                <div class="li link_gray6 J_hoverbut t6 select" onclick="window.location='{{url('resume/interview')}}'">
                    面试邀请
                </div>
                {{--<div class="li link_gray6 J_hoverbut t8" onclick="window.location='{{url('resume/favorites')}}'">收藏的简历--}}
                {{--</div>--}}
                {{--<div class="li link_gray6 J_hoverbut t9" onclick="window.location='{{url('resume/log')}}'">浏览过的简历</div>--}}

            </div>
        </div>
        <div class="mright">
            <div class="user_pagetitle">
                <div class="pat_l">我发起的面试邀请</div>
                <!--<div class="pat_r">系统保留三个月的记录，共<strong> {$interview['count']} </strong>条</div>-->
                <div class="clear"></div>
            </div>

            <div class="user_tab">
                <div class="btnbox resume_list">
                    <form id="ajax_search_location" action="" method="get">
                        <input name="key" id="key" type="text" class="input_245_34" placeholder="请输入职位名称"
                               value="@if(isSet($params['key'])){{$params['key']}}@endif">
                        <!--<input type="text" name="key" class="soinput" placeholder="请输入关键字" />-->
                        <div class="btn_yellow J_hoverbut btn_inline btnSearch" id="search" style="padding: 7px 15px;">
                            搜人才
                        </div>
                    </form>
                </div>
            </div>

            <div class="resume_interview_th">
                <div class="th1">姓名</div>
                <div class="th2">基本信息</div>
                <div class="th3">期望薪资</div>
                <div class="th4">
                    <div class="input_90_30_div J_hoverinput J_dropdown J_listitme_parent">
						<span class="J_listitme_text">
							@if(isSet($params['t']))
                                @if($params['t'] ==3)
                                    3天内
                                @elseif($params['t'] ==7)
                                    7天内
                                @elseif($params['t'] ==15)
                                    15天内
                                @elseif($params['t'] ==30)
                                    30天内
                                @endif
                            @else
                                邀请时间
                            @endif

						</span>
                        <div class="dropdowbox11 J_dropdown_menu">
                            <div class="dropdow_inner11">
                                <ul class="nav_box">
                                    <li><a class="J_listitme" href="javascript:;" data-content="0">不限时间</a></li>
                                    <li><a class="J_listitme" href="javascript:;" data-content="3">3天内</a></li>
                                    <li><a class="J_listitme" href="javascript:;" data-content="7">7天内</a></li>
                                    <li><a class="J_listitme" href="javascript:;" data-content="15">15天内</a></li>
                                    <li><a class="J_listitme" href="javascript:;" data-content="30">30天内</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="th5">操作</div>
                <div class="clear"></div>
            </div>
            <form id="form1" action="" method="post" class="J_allListBox">
                @if($list)
                    @foreach($list as $item)
                        <div class="resume_interview">
                            <div class="td1 link_blue substring l13">
                                {{--<input name="y_id[]" class="J_allList" type="checkbox" value="">--}}
                                &nbsp;<a href="" target="_blank" title="">{{$item->nickname}}</a>
                            </div>
                            <div class="td2">
                                {{$item->birth_cn}} | {{$item->sex_cn}}
                                | {{$item->education_cn?$item->education_cn:"保密"}}
                                | {{$item->experience_cn?$item->experience_cn:'保密'}}
                            </div>
                            <div class="td3">{{$item->wage_cn}}</div>
                            <div class="td4">{{date("Y-m-d",$item->create_time)}}</div>
                            <div class="td5 link_blue" style="padding-left: 25px;width: 75px" >
                                {{--<a href="javascript:;" class="J_interviewDetails info" did="{{$item->id}}">详情</a>&nbsp;&nbsp;--}}
                                <a href="javascript:;" data-href="{{url('interview/delete',[$item->id])}}" class="del">关闭</a>
                            </div>
                            <div class="clear"></div>
                        </div>
                    @endforeach



                    {{--<div class="resume_but">--}}
                    {{--<div class="td1"><input class="J_allSelected" type="checkbox" value=""/></div>--}}
                    {{--<div class="td2">--}}
                    {{--<div class="btn_lightgray J_hoverbut btn_inline" id="delete">删除</div>--}}
                    {{--</div>--}}
                    {{--<div class="clear"></div>--}}
                    {{--</div>--}}
                    <div class="qspage">{{$list->links()}}</div>
                @else
                    <div class="res_empty">
                        抱歉，没有找到符合您条件的简历，建议您修改筛选条件后重试
                    </div>
                @endif

            </form>
        </div>
    </div>
</div>
<script type="text/javascript" src="{{asset('static/js/jquery.min.js')}}"></script>
<script type="text/javascript" src="{{asset('static/js/jquery.dropdown.js')}}"></script>
<script type="text/javascript" src="{{asset('static/js/jquery.disappear.tooltip.js')}}"></script>

<script>
    function changeURLArg(url, arg, arg_val) {
        let pattern = arg + '=([^&]*)';
        let replaceText = arg + '=' + arg_val;
        if (url.match(pattern)) {
            var tmp = '/(' + arg + '=)([^&]*)/gi';
            tmp = url.replace(eval(tmp), replaceText);
            return tmp;
        } else {
            if (url.match('[\?]')) {
                return url + '&' + replaceText;
            } else {
                return url + '?' + replaceText;
            }
        }
    }

    $(".J_listitme").click(function () {
        var url = window.location.href;
        url = changeURLArg(url, 't', $(this).data('content'));
        location.href = url;
    });
    $('#search').click(function () {
        $('#ajax_search_location').submit();
    });
    $('.del').click(function () {
        $.ajax({
            url: $(this).data('href'),
        }).done(function (data) {
            disapperTooltip('success', "成功");
            setTimeout(function () {
                window.location.reload();
            }, 1000);
        }).fail(function (result) {
            disapperTooltip("remind", result.msg);
        });
    })
</script>
